package com.itheima.job;

import com.itheima.utils.ZKSelectMasterUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;

/**
 * @program: virtual-trade-parent
 * @description: zookeeper的分布式锁, 用来选择主节点
 * @author: zhanghz001
 * @create: 2021-07-12 09:32
 **/
// @Configuration
public class ZhzZkConfig {
    @Autowired
    private SystemParamProperties systemParamProperties;
    
    @Bean
    public ZKSelectMasterUtil zkSelectMasterUtil() {
        ZKSelectMasterUtil zkSelectMasterUtil = new ZKSelectMasterUtil();
        zkSelectMasterUtil.setZkAddress(systemParamProperties.getZkAddr());
        return zkSelectMasterUtil;
    }
}
